<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="fck" %>
<%@page import="java.util.*,model.*,util.*,control.*"%>
<!DOCTYPE html>
<html>
<head>
    <title>自适应测评系统</title>
    <meta charset="utf-8"/>
    <script  src='../../js/core.js'></script>
    <script  src='../../js/jquery-1.4.2.js'></script>
    <script  src='../../js/rows.js'></script>
    <link type="text/css" rel='stylesheet' href="../../css/common.css"/>
    <link type="text/css" rel='stylesheet' href="../../css/houtai.css"/>
</head>
           <%
           /***********************************************************************************/
           /*
           *验证权限
           *author 胡瑾
           *data 2011-12-08
           */
			String flag = (String)session.getAttribute("flag");
			String userId = (String)session.getAttribute("userId");
			int adminId = Integer.parseInt(userId);
						
			if (flag != "admin"|| flag == null )
			{
				%>
      <script language="javascript">
				     alert("您没有管理员权限,请重新登录"); window.location.href="../../index.jsp";
				    </script>
      <%
				
			}else{
				Admin admin = new Admin();
				AdminControl ac = new AdminControl();
				admin = ac.GetAdmin(adminId);
				//out.print("<p>"+admin.getName()+"   欢迎您</p>");
				
			}
			/*********************************************************************************/
           %>
<body>
       <%
		int k = 0;
		request.setCharacterEncoding("utf-8");
		int pages = ParamUtil.getInt(request,"pages",1);
		int rowsPerPage = ParamUtil.getInt(request,"pageSize",20);
	    Answerlog answerlog = new Answerlog();
		AnswerlogControl alc = new AnswerlogControl();
	
		List<Answerlog>list = new ArrayList<Answerlog>();
		list = (List)alc.GetAnswerlog();
		%>
<form action="answerlog_chuli.jsp" method = "post" name="form">
    <p style='margin: 0 auto; text-align:center;margin-top:40px;'>根据学生ID进行查看
      <select name="studentId">
      <%
		/**************************************************************************/
		/*判重
		*陈星
		*2011-12-08
		*/
		//System.out.println("总个数" + list.size());
		others o = new others();
		boolean vis[] = new boolean[o.getMaxIdForAnswerlog() + 1];
		System.out.println("size" + list.size());
		for(int i = 0; i<list.size();i++)
		{
			answerlog = list.get(i);
			int tmp = answerlog.getStudentId();
			//System.out.println(tmp);
			if(vis[tmp]) continue;
			vis[tmp] = true;
		/**********************************************************************************/

		%>
        <option value="<%=answerlog.getStudentId()%>"><%=answerlog.getStudentId() %></option>
        <%
	    } 
%>
      </select></p>
     <p style='margin: 20px auto; width:160px;'><input name="submit" type='submit' class='btns br3' value="确    定"></p>
    </form>
</body> 
</html>
